<html>
<head><meta charset="utf-8"><title>thread join panics · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/thread.20join.20panics.html">thread join panics</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218026526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/thread%20join%20panics/near/218026526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/thread.20join.20panics.html#218026526">(Nov 26 2020 at 17:53)</a>:</h4>
<p>Hi. When joining a thread we get a <a href="https://doc.rust-lang.org/std/thread/type.Result.html">https://doc.rust-lang.org/std/thread/type.Result.html</a>. The doc there suggest using <code>unwrap</code>, but I suspect the error message would be poor since <code>Box&lt;Any&gt; as Debug</code> does not give particularly useful output. Would using <code>resume_unwind</code> instead make sense? Even though <code>catch_unwind</code> isn’t used (except maybe by <code>std</code>)</p>



<a name="218026651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/thread%20join%20panics/near/218026651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/thread.20join.20panics.html#218026651">(Nov 26 2020 at 17:55)</a>:</h4>
<p>libstd does use <code>catch_unwind</code> internally on the newly spawned thread: <a href="https://github.com/rust-lang/rust/blob/0beba9333754ead8febc5101fc5c35f7dcdfaadf/library/std/src/thread/mod.rs#L473">https://github.com/rust-lang/rust/blob/0beba9333754ead8febc5101fc5c35f7dcdfaadf/library/std/src/thread/mod.rs#L473</a></p>



<a name="218026712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/thread%20join%20panics/near/218026712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/thread.20join.20panics.html#218026712">(Nov 26 2020 at 17:56)</a>:</h4>
<p><code>resume_unwind</code> would make sense to me. There is likely no need for another backtrace.</p>



<a name="218028258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/thread%20join%20panics/near/218028258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/thread.20join.20panics.html#218028258">(Nov 26 2020 at 18:18)</a>:</h4>
<p>yeah if you want to propagate the panic resume_unwind a good choice</p>



<a name="218029148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/thread%20join%20panics/near/218029148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/thread.20join.20panics.html#218029148">(Nov 26 2020 at 18:31)</a>:</h4>
<p>Sounds good, thanks!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>